<template>
    <section class="form-common">
  			<el-form :inline="true" :model="formInline" class="demo-form-inline">
			  <el-form-item :label="item.label" v-for="(item,index) in formLabel" >
			  	<el-select v-if="item.type==='select'" v-model="formInline[item.model]" :placeholder="item.placeholder">
			         <el-option v-for="(optionItem,optionIndex) in item.options" :label="optionItem.name" :value="optionItem.id"></el-option>
			    </el-select>
                <el-input v-if="item.type==='input'"  v-model="formInline[item.model]" :placeholder="item.placeholder">
                    <el-button slot="append" icon="el-icon-search" @click="$emit('search',formInline)" ></el-button>         
                </el-input> 
			    <el-button type="primary" v-if="item.type==='button'" @click="$emit(item.method,formInline)">{{item.placeholder}}</el-button>
			  </el-form-item>
			  
			</el-form>
    </section>
</template>

<script>
    
    export default {
    	props:{
    		formLabel:Array,
    	},
        data() {
          return {
          	formInline:{},
          };
        },
        methods: {
        	add(){
        		// alert("dwa");
        	}
        }
  };
</script>

<style scoped="scoped">
    
</style>